//
//  CalendarWeekView.swift
//  DaGlass
//
//  Created by 李然 on 2023/4/6.
//

import UIKit
import MoyoungLib

class CalendarWeekView: View {

    override func makeUI() {
        super.makeUI()
        self.addSubview(weekStackView)
        weekStackView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
    }

    public func updateDatas(datas: [String]) {
        weekStackView.removeAllSubViews()
        for title in datas {
            let label = UILabel()
            label.font = Fonts.systemFont(ofSize: 12)
            label.textColor = R.color.common_3_text()
            label.textAlignment = .center
            label.text = title
            weekStackView.addArrangedSubview(label)
        }
    }

    private lazy var weekStackView: StackView = {
        let weekStackView = StackView()
        weekStackView.axis = .horizontal
        weekStackView.distribution = .fillEqually
        weekStackView.alignment = .center
        weekStackView.spacing = 5
        return weekStackView
    }()

}
